package com.jiesen.base.modules.certificate.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.jiesen.base.modules.certificate.model.JsUser;
import com.jiesen.base.modules.certificate.service.IJsUserService;
import com.jiesen.base.utils.R;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bao
 */

@RestController
@RequestMapping(value = "/jsUser", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class JsUserController {

	@Autowired
	private IJsUserService jsUserService;
	
	@RequestMapping("/getList")
    @ResponseBody
	public R getList(JsUser jsUser) {
		return jsUserService.page(jsUser);
	} 
	
	@RequestMapping("/delUser")
    @ResponseBody
	public boolean delUser(String id) {
		return jsUserService.removeById(id);
	}
	
	@RequestMapping("/addUser")
    @ResponseBody
	public JsUser addUser(JsUser jsUser) {
		jsUserService.save(jsUser);
		return jsUser;
	}
	
	@RequestMapping("/updUser")
    @ResponseBody
	public JsUser updUser(JsUser jsUser) {
		jsUserService.updateById(jsUser);
		return jsUser;
	}
	
}
